package com.hbnu;
public class OrderDetail {
    private int id;
    private int orderId;
    private int flowerId;
    private int quantity;
    private double subtotal;

    public OrderDetail(int id, int orderId, int flowerId, int quantity, double subtotal) {
        this.id = id;
        this.orderId = orderId;
        this.flowerId = flowerId;
        this.quantity = quantity;
        this.subtotal = subtotal;
    }

    public OrderDetail(int orderId, int flowerId, int quantity, double subtotal) {
        this.orderId = orderId;
        this.flowerId = flowerId;
        this.quantity = quantity;
        this.subtotal = subtotal;
    }

    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public int getOrderId() { return orderId; }
    public void setOrderId(int orderId) { this.orderId = orderId; }
    public int getFlowerId() { return flowerId; }
    public void setFlowerId(int flowerId) { this.flowerId = flowerId; }
    public int getQuantity() { return quantity; }
    public void setQuantity(int quantity) { this.quantity = quantity; }
    public double getSubtotal() { return subtotal; }
    public void setSubtotal(double subtotal) { this.subtotal = subtotal; }

    @Override
    public String toString() {
        return String.format("明细[%d] 订单ID:%d 花卉ID:%d 数量:%d 小计:%.2f",
                id, orderId, flowerId, quantity, subtotal);
    }
}

